import server from './server';
//法币交易

export const shopapply = (data) => { //成为商家
    return server.post('/fbTrade/shop_apply', data)
}

export const shopapplyindex = (data) => { //商家申请页面
    return server.get('/fbTrade/shop_apply_index', {
        params: data
    })
}

export const shopcancel = (data) => { //撤销商家
    return server.post('/fbTrade/shop_cancel', data)
}

export const issueorderlist = (data) => { //交易记录
    return server.get('/fbTrade/issue_order_list', {
        params: data
    })
}
export const commondata = (data) => { //法币交易公共信息
    return server.get('/fbTrade/common_data', {
        params: data
    })
}
export const paylist = (data = null) => { //支付方式列表
    return server.get('/fbTrade/pay_list', {
        params: data
    })
}

export const issueorder = (data) => { //发布交易单
    return server.post('/fbTrade/issue_order', data)
}

export const revokeorder = (data) => { //撤销发布订单
    return server.post('/fbTrade/revoke_order', data)
}

export const orderlists = (data, hideloading) => { ////法币交易 订单 交易明细
    return server.get('/fbTrade/order_list', {
        params: data,
        hideloading
    })
}

export const accountinfo = (data) => { ////账户资产
    return server.get('/account/index', {
        params: data
    })
}

export function orderdetail(params,hideloading) {
    return server.get('/fbTrade/order_detail', {
        params,
        hideloading
    })
}

export function cancelorder(data) {
    return server.post('/fbTrade/cancel_order', data)
}

export function payorder(data) {
    return server.post('/fbTrade/pay_order', data);
}

export function confirm(data) {
    return  server.post('/fbTrade/confirm', data);
}

export function appeal(data) {
    return server.post('/fbTrade/appeal', data);
}

export function trading(params) {
    return server.get(`/fbTrade/trading`, {
        params
    })
}

export function createorder(data) {
    return server.post('/fbTrade/create_order', data);
}

export function setstatus(data) {
    return server.post(`/fbTrade/set_status`, data);
}


export function paymentinfo(payment_id) {
    return server.get(`/fbTrade/payment_info`, {
        params : {
            payment_id
        }
    })
}

export function paymentadd(data) {
    return server.post('/fbTrade/payment_add', data);
}